﻿using System;
using System.Collections.Generic;
using System.Text;
using T.FAS.Runtime.Base.Entity;
using T.FAS.Runtime.Metadata.Entity.DataModel;
using T.FAS.Runtime.StateMachine.SPI;

namespace T.FAS.Runtime.StateMachine.Engine
{
    class FrozenRuleProcess : IRuleProcess
    {
        public const string CSTKEY = "Frozen";

        public string Key => CSTKEY;

        public string Description => "冻结修改";

        public List<ParamInfo> NeedParamInfo => null;

        public bool IsPreCheck => false;

        public bool Check(TRecord record, TState state,TRule rule, StateMachineMetadata metadata, StringBuilder failReason)
        {
            //需要客户端控制

            //服务端最好获取检查数据是否修改
            return true;
        }
    }

    class ReadOnlyRuleProcess : IRuleProcess
    {
        public const string CSTKEY = "ReadOnly";

        public string Key => CSTKEY;

        public string Description => "只读设置";

        public bool IsPreCheck => false;

        public List<ParamInfo> NeedParamInfo => null;

        public bool Check(TRecord record, TState state, TRule rule, StateMachineMetadata metadata, StringBuilder failReason)
        {
            //需要客户端控制

            //服务端最好获取检查数据是否修改
            return true;
        }
    }
}
